#!/usr/bin/env bash

# Are we running this program in Windows?
#
# If this program is running in Windows we will rewrite the incompatible parts and run it
# again with the changes.
#
# Introduce yourself to the user.
#
  printf "\n\n"
  printf "Hello, $USER...\n\n"
  printf "I am going to ask you some questions so that we can get Faridayix installed on\n"
  printf "the device of your choice.\n\n"
  printf "If after I ask you a question and you require advice, input advise followed by\n"
  printf "a word in bold.\n\n"
  printf "If you want to know all of the things I can advise you on, input advise advise.\n\n"

# Are we running this program as the root user?
#
# If we are not running the program as the root user.
#
  printf "Since you are running me as $USER and not the root user I will assume that"
  printf "\n"
  printf "the programs that I require to be run as root will be done by using the sudo"
  printf "\n"
  printf "program."
  printf "\n"
  printf "\n"
  printf "If your operating system does not use the sudo program, exit my program now and"
  printf "\n"
  printf "run me as the root user."
  printf "\n"
  printf "\n"
  printf "Would you like to exit my program now? "
  printf "\n"

# What disk devices are available on the system to install Faridayix on?
#
  sudo fdisk -l

# Compact Disc
#

# Flash Drive
#
  printf "\n"
  printf "Which of the devices listed above would like to install Faridayix on? /dev/"

  read flash_device

# Is the flash device mounted?
#
# Mounting status code below
#

# If the flash device is mounted do the following.
#
sudo umount /dev/$flash_device

# Remove all data from the flash device.
#
#sudo dd if=/dev/zero of=/dev/$flash_device

# Output flash device partition scheme to file.
#
sudo rm /tmp/flash-device-partitions

sudo printf "0, 136, 1,*" >> /tmp/flash-device-partitions

# Read flash device partition file and partition flash device.
#
sudo sfdisk /dev/$flash_device << /tmp/flash-device-partitions

# Hard Drive
#
